public class Car {
	private String model;
	private double maxSpeed;
	private double currentSpeed;
	private int currentGear;
	private int numberOfDoors;
	private String idNumber;
	private boolean isSportCar;
	private Person owner;
	private boolean isEngineOn;
	private Object color;
	@Override
public boolean equals(Object obj) {
		if(obj instanceof Car){
			Car otherCar= (Car) obj;
	
	return this.model.equals(otherCar.getModel()) && this.color.equals(otherCar.color);
		}
		return false;
	}
	
	
	Car(int numberOfDoors, boolean isSportCar){
		 this.numberOfDoors=numberOfDoors;
		 this.isSportCar=isSportCar;
	}

	void changeOwner(Person newOwner) {
		owner = newOwner;

	}

	protected void startEngine() {
		isEngineOn=!isEngineOn;
		if(isEngineOn)
			System.out.println("Engine is now on");
		else
			System.out.println("Engine is now off");
		
	}

	void changeGear(int gear) {
		if (gear > 0)
			this.currentGear = gear;
	}

	void accelerate(double speed) {
		if (speed >= 0) {
			this.currentSpeed += speed;
		}
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public double getMaxSpeed() {
		return maxSpeed;
	}

	public void setMaxSpeed(double maxSpeed) {
		if(maxSpeed>0)
		this.maxSpeed = maxSpeed;
	}

	public double getCurrentSpeed() {
		return currentSpeed;
	}

	public void setCurrentSpeed(double currentSpeed) {
		this.currentSpeed = currentSpeed;
	}

	public int getCurrentGear() {
		return currentGear;
	}

	public void setCurrentGear(int currentGear) {
		this.currentGear = currentGear;
	}

	public int getNumberOfDoors() {
		return numberOfDoors;
	}

	public void setNumberOfDoors(int numberOfDoors) {
		this.numberOfDoors = numberOfDoors;
	}

	public String getIdNumber() {
		return idNumber;
	}

	public void setIdNumber(String idNumber) {
		this.idNumber = idNumber;
	}

	public boolean isSportCar() {
		return isSportCar;
	}

	public void setSportCar(boolean isSportCar) {
		this.isSportCar = isSportCar;
	}

	public Person getOwner() {
		return owner;
	}

	public void setOwner(Person owner) {
		this.owner = owner;
	}

	public boolean getIsEngineOn() {
		return isEngineOn;
	}

	public void setEngineOn(boolean isEngineOn) {
		this.isEngineOn = isEngineOn;
	}

}
